# encoding: utf-8
"""
# @Author: Sen
# @Project: Python_app
# @File：app_01_hello.py
# @illustrate: appium操作模拟器
# @CreateTime: 2025/6/20 17:49
"""
import time

from appium import webdriver
from appium.options.android import UiAutomator2Options

capabilities = dict(
    # 系统类型
    platformName='Android',
    # UiAutomator2 驱动
    automationName='uiautomator2',
    # 模拟器设备号
    deviceName='Android',
    # 包名
    appPackage='com.tencent.mm',
    # 界面名
    appActivity='.ui.LauncherUI'
)

# appium服务器地址
appium_server_url = 'http://localhost:4723/wd/hub'

# app驱动对象
driver = webdriver.Remote(appium_server_url, options=UiAutomator2Options().load_capabilities(capabilities))

time.sleep(5)

# 退出
driver.quit()
